﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Caltech.Models
{
    [Bind(Exclude = "Salesman,Company")]
    public class QuoteModel : BaseModel
    {
        public int CompanyId { get; set; }
        public CompanyModel Company { get; set; }
        public SalesmanModel Salesman { get; set; }
        public DateTime? QuoteDate { get; set; }
        public IEnumerable<QuoteEquipmentModel> Items { get; set; }
        public long ServiceCharges { get; set; }
        public float Tax { get; set; }
        public float ExchangeRate { get; set; }
        public string QuoteNumber { get; set; }
    }

    public class QuoteSearchModel : BaseModel
    {
        public string CompanyName { get; set; }
        public string SalesmanName { get; set; }
        public DateTime? QuoteDate { get; set; }
        public string QuoteNumber { get; set; }
        public int CompanyId { get; set; }
        public string SalesmanId { get; set; }
    }

    public class CompanyModel : BaseModel
    {
        [Required]
        public string Name { get; set; }
        public string Address { get; set; }
        [Phone]
        public string Tel { get; set; }
        [Phone]
        public string Mobile { get; set; }
        public string ContactPersonName { get; set; }
        [EmailAddress]
        public string Email { get; set; }

        //TODO: workorder?
        public string Fax { get; set; }
    }

    public class SalesmanModel : BaseModel
    {
        public string FullName { get; set; }
        [Phone]
        public string Mobile { get; set; }
        [Phone]
        public string Tel { get; set; }
        [EmailAddress]
        public string Email { get; set; }
    }

    public class QuoteEquipmentModel : BaseModel
    {
        public string PoNumber { get; set; }
        public string Name { get; set; }
        public string Manufacturer { get; set; }
        public string SerialNumber { get; set; }
        public string ModelNumber { get; set; }
        public int EquipmentId { get; set; }
        public int Quantity { get; set; }
        public float UnitPrice { get; set; }
        public int? ServicePlace { get; set; }
    }
}